package com.example.testapp.activity.activity.read;

import android.annotation.TargetApi;
import android.app.Activity;
import android.app.ActivityOptions;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.util.Pair;
import android.view.View;

import com.example.testapp.R;
/**
 * Created by l on 2016/7/27.
 */
public class PathActivity extends AppCompatActivity {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_photo);
        initView();
    }

    private void initView() {
        findViewById(R.id.btn1).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                startActivity(new Intent(PathActivity.this, ReflectViewTestActivity.class));
            }
        });

        findViewById(R.id.btn2).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                startActivity(new Intent(PathActivity.this, ImageMatrixTestActivity.class));
            }
        });

        findViewById(R.id.btn3).setOnClickListener(new View.OnClickListener() {
            @TargetApi(Build.VERSION_CODES.LOLLIPOP)
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(PathActivity.this, ModeViewActivity.class);
                intent.putExtra("flag", 0);
                    startActivity(intent,
                            ActivityOptions.makeSceneTransitionAnimation(PathActivity.this).toBundle());
            }
        });

        findViewById(R.id.btn4).setOnClickListener(new View.OnClickListener() {
            @TargetApi(Build.VERSION_CODES.LOLLIPOP)
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(PathActivity.this, ModeViewActivity.class);
                intent.putExtra("flag", 1);
                startActivity(intent,
                        ActivityOptions.makeSceneTransitionAnimation(PathActivity.this).toBundle());
            }
        });

        findViewById(R.id.btn5).setOnClickListener(new View.OnClickListener() {
            @TargetApi(Build.VERSION_CODES.LOLLIPOP)
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(PathActivity.this, ModeViewActivity.class);
                intent.putExtra("flag", 2);
                startActivity(intent,
                        ActivityOptions.makeSceneTransitionAnimation(PathActivity.this).toBundle());
            }
        });

        findViewById(R.id.btn6).setOnClickListener(new View.OnClickListener() {
            @TargetApi(Build.VERSION_CODES.LOLLIPOP)
            @Override
            public void onClick(View v) {
                View fab = findViewById(R.id.fab_button);
                Intent intent = new Intent(PathActivity.this, ModeViewActivity.class);
                intent.putExtra("flag", 3);
                startActivity(intent,
                        ActivityOptions.makeSceneTransitionAnimation(PathActivity.this, Pair.create(v, "share"), Pair.create(fab, "fab")).toBundle());
            }
        });
    }
}
